﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace snat.util {
    /// <summary>
    /// This class defines a simple data point for charting.
    /// For a line chart, the dependentValue is represented 
    /// as the y value, and the independent as the x value.
    /// </summary>
    public class DataPoint : INotifyPropertyChanged {

        private object independentValue;
        public object IndependentValue {
            get { return independentValue; }
            set {
                independentValue = value;
                if (PropertyChanged != null) {
                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs("IndependentValue"));
                }
            }
        }
        private object dependentValue;
        public object DependentValue {
            get { return dependentValue; }
            set {
                dependentValue = value;
                if (PropertyChanged != null) {
                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs("DependentValue"));
                }
            }
        }

        public DataPoint(object xValue, object yValue) {
            independentValue = xValue;
            dependentValue = yValue;
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
